package config

import (
	"192.168.1.75/go-pkg/gormx"
	"192.168.1.75/go-pkg/logx"
	"192.168.1.75/go-pkg/redisx"
)

var Config ConfigType

type ConfigType struct {
	// 对外http接口端口
	HTTPPort string `mapstructure:"http_port"`
	// grpc端口
	GRPCPort string `mapstructure:"grpc_port"`
	// mysql配置
	Mysql gormx.Config `mapstructure:"mysql"`
	// 自动数据迁移检查
	AutoMigrate bool `mapstructure:"auto_migrate"`
	// 禁止重启检查，主要用于本地开发
	DisableRestartCheck bool `mapstructure:"disable_restart_check"`
	// redis 配置
	Redis redisx.Config `mapstructure:"redis"`
	// 日志配置
	Log logx.Config `mapstructure:"log"`
	// 文件保存路径
	FileSaveDir string `mapstructure:"file_save_dir"`
	// 本地服务,serviceName-serviceConf【ip:http_port:grpc_port】
	LocalServices            map[string]string `mapstructure:"local_services"`
	AlipayNotifyUrl          string            `mapstructure:"alipay_notify_url"`
	WechatNotifyUrl          string            `mapstructure:"wechat_notify_url"`
	WechatComplaintNotifyUrl string            `mapstructure:"wechat_complaint_notify_url"`
	BaseUrl                  string            `mapstructure:"base_url"`
	LogTracing               bool              `mapstructure:"log_tracing"`
	WechatV3Config           struct {
		MchID        string `mapstructure:"mch_id"`
		SerialNo     string `mapstructure:"serial_no"`
		APIv3Key     string `mapstructure:"apiv3_key"`
		ApiclientKey string `mapstructure:"apiclient_key"`
	} `mapstructure:"wechat_v3_config"`
	ZhenghongPoints struct {
		BaseURL   string `mapstructure:"base_url"`
		APPKey    string `mapstructure:"app_key"`
		APPSecret string `mapstructure:"app_secret"`
	} `mapstructure:"zhenghong_points"`
	MallcooPoints struct {
		BaseURL    string `mapstructure:"base_url"`
		APPID      string `mapstructure:"appid"`
		MallID     string `mapstructure:"mallid"`
		PublicKey  string `mapstructure:"public_key"`
		PrivateKey string `mapstructure:"private_key"`
	} `mapstructure:"mallcoo_points"`
	WinPoints struct {
		BaseURL     string `mapstructure:"base_url"`
		AccessToken string `mapstructure:"access_token"`
		MallID      string `mapstructure:"mall_id"`
		Source      string `mapstructure:"source"`
		Secret      string `mapstructure:"secret"`
	} `mapstructure:"win_points"`
	WanxiangPoints struct {
		BaseURL   string `mapstructure:"base_url"`
		AppID     string `mapstructure:"app_id"`
		APPSecret string `mapstructure:"app_secret"`
		Env       string `mapstructure:"env"`
	} `mapstructure:"wanxiang_points"`
	WechatMini struct {
		AppID  string `mapstructure:"app_id"`
		Secret string `mapstructure:"secret"`
	} `mapstructure:"wechat_mini"`
	SMSTemplateCode  string `mapstructure:"sms_template_code"`
	SMSTemplateCode1 string `mapstructure:"sms_template_code1"`
	SMSTemplateCode2 string `mapstructure:"sms_template_code2"`
	Feishu           struct {
		ComplaintNotifyWebhook string `mapstructure:"complaint_notify_webhook"` // 投诉通知
	} `mapstructure:"feishu"`
}
